package com.gmail.hy87cn.hellohi.client;

import com.gmail.hy87cn.hellohi.shared.HiMessage;
import com.gmail.hy87cn.hellohi.shared.HiRoom;
import com.gmail.hy87cn.hellohi.shared.HiUpdateException;
import com.google.gwt.user.client.rpc.AsyncCallback;

/**
 * The async counterpart of <code>HiService</code>.
 */
public interface HiServiceAsync {

	void getToken(AsyncCallback<Integer> callback);

	void updateMessages(int token, int lastIndex,
			AsyncCallback<HiMessage[]> callback) throws HiUpdateException;

	void sendMessage(int token, String input, AsyncCallback<Void> callback);

	void connect(int token, String facebookId, AsyncCallback<Void> callback);

	void disconnect(int token, AsyncCallback<Void> callback);

	void releaseToken(int token, AsyncCallback<Void> callback);

	void getRoom(int token, AsyncCallback<HiRoom> callback);
}
